import { CACHE_USERINFO, CACHE_TOKEN, CACHE_EXPIRES_TIME } from '../../config.js';
import Util from '../../utils/util.js';
import { getLogo } from '../../api/api.js';
import { login } from '../../api/user.js';

let app = getApp();

Component({
    properties: {
        windowShow: {
            type: Boolean,
            value: false,
        },
        remark: {
            type: String,
            value: '',
        }
    },
    data: {
        mark: '',
        wechat_number: '',
        qq_number: '',
        to_name: '',
        birthday: '',
    },
    attached() {

    },
    ready(){
        console.log('this.data---->', this.data);
        this.setData({
            mark: this.data.remark,
        })
    },
    methods: {
        close(){
            this.setData({
                windowShow: true
            });
        },
        submit() {
            let {mark} = this.data;
            if ([mark].includes('')) {
                app.Tips({ title: '请检查信息！' });
                return
            }
            let data = {
                mark,
            };
            this.triggerEvent('SubmitWindow', data);
            this.setData({
                windowShow: true
            });
        },
        dateChange(e) {
            let data = e.detail.value.split("-");
            let _data = data.join("");
            this.setData({birthday: _data});
        },
        bindHideKeyboard: function (e) {
            switch (e.currentTarget.dataset.name) {
                case 'mark':
                    this.setData({
                        mark: e.detail.value,
                    })
                    break;
                default:
                    break;
            }
        },
    },
})